#ifndef CAMERASCTRL_H
#define CAMERASCTRL_H

#include "PluginMgr.h"
#include <functional>
#include "QDialog"
#include "QPushButton"
#include "QBoxLayout"
#include <QString>

namespace Ui
{
	class camerasCtrl;
};


class camerasCtrl
	:public QDialog
{
	Q_OBJECT

public:

	typedef std::function<void(void)> sub_interface_panel_set_callback;
	camerasCtrl(QWidget* parent);
	~camerasCtrl();

	void DestroryAllSubInterface();
	void DestroryAllInterface();

	QWidget* GetSubInterfacePanel();
	QVBoxLayout* GetSubInterfaceLayOut();
	
	void RegisterButtonClickCallbacks(std::vector<sub_interface_panel_set_callback> cb)
	{
		set_callbacks.clear();
		set_callbacks = cb;
	}


protected:
	void DrawComment(std::wstring comment, bool read_only);
	

	CameraPlugin * GetCurrentCamera();
protected slots:
	void on_cmbDevChange(int nIndex);
	void on_cmbCCDChange(int nIndex);
	void on_cmbCamChange(int nIndex);
	void on_btnCmdCLick();
	virtual void accept();

private:
	QVBoxLayout* m_layInterface;
	QVBoxLayout* m_laySubInterface;
	Ui::camerasCtrl* ui;
	QString current_camera;
	std::vector<sub_interface_panel_set_callback> set_callbacks;
	std::vector<int> valid_ccd_serials;
};


#endif // CAMERASCTRL_H
